package ooday05;

public class EnumDemo {
    public static void main(String[] args) {
        System.out.println(Season.SPRING);
        System.out.println(Season.SPRING.getSeasonName()+","+Season.SPRING.getSeasonScr());
        Season s = Season.SUMMER;
        System.out.println(s.getSeasonName()+","+s.getSeasonScr());
        //Season season = Season.valueOf("AUTUMN");
        //System.out.println(season.getSeasonName()+","+season.getSeasonScr());
        Season[] seasons = Season.values();
        for(int i = 0;i<seasons.length;i++){
            System.out.println(seasons[i].getSeasonName());
            System.out.println(seasons[i].getSeasonScr());
        }
        System.out.println("--------------------------------------------------");
        Season season = Season.WINTER;
        switch (s){
            case SPRING:
                System.out.println(season.getSeasonName()+":"+season.getSeasonScr());
                break;
            case SUMMER:
                System.out.println(season.getSeasonName()+":"+season.getSeasonScr());
                break;
            case AUTUMN:
                System.out.println(season.getSeasonName()+":"+season.getSeasonScr());
                break;
            case WINTER:
                System.out.println(season.getSeasonName()+":"+season.getSeasonScr());
                break;
        }

    }
}
